<html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:xf="http://www.w3.org/2002/xforms"
        xmlns:lsc="http://rjlg.com/labspaces/core#"
        xmlns:lsme="http://rjlg.com/labspaces/medicalexaminer#"
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
        xmlns:foaf="http://xmlns.com/foaf/0.1/"
        xmlns:ev="http://www.w3.org/2001/xml-events">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <title>Themis</title>
    <link rel="apple-touch-icon" href="icon.png"/>
    <link rel="apple-touch-icon" sizes="72x72" href="icon.png"/>
    <link rel="apple-touch-icon" sizes="114x114" href="icon.png"/>
    <link rel="apple-touch-startup-image" href="startup.png"/>
    <link rel="stylesheet" href="/resources/jquery/jquery-ui-autocomplete.css"/>
    <link rel="stylesheet" href="/resources/jquery/jquery.mobile-1.0.min.css"/>
    <link rel="stylesheet" href="/resources/swift-xforms/css/xforms.css"/>
    <script src="/resources/jquery/jquery-1.6.4.min.js"></script>
    <script type="text/javascript" src="/resources/jquery/jquery-ui-autocomplete.min.js"></script>
    <script src="/resources/jquery/jquery.mobile-1.0.min.js"></script>
    <script src="/resources/jquery/jquery.xmlns.js"></script>
    <script type="text/javascript" src="/resources/swift-xforms/js/jquery.xforms.js"></script>
</head>
<body>
<script id="agent" type="text/xml" data-role="model">
    <xf:model>
        <xf:instance id="agents" src="/swift/services/agent"/>
        <xf:instance id="agent-out">
            <rdf:RDF>
                <rdf:Description rdf:about="mrnew">
                    <lsc:nkey></lsc:nkey>
                    <foaf:name></foaf:name>
                </rdf:Description>
            </rdf:RDF>
        </xf:instance>
        <xf:instance id="agent-request">
            <request>
                <runMashup>
                    <agent>mranalyst</agent>
                </runMashup>
            </request>
        </xf:instance>
        <xf:submission id="agent-submit" ref="instance('agent-request')/runMashup" instance="agent-out" method="post"
                       resource="/swift/services/agent"/>
        <xf:action ev:observer="a[href='#agentPage']" ev:event="click">
            <xf:setvalue ref="instance('agent-request')/runMashup/agent" value="."/>
            <xf:send submission="agent-submit"/>
        </xf:action>
    </xf:model>
</script>
<div data-role="page" id="agentsPage" data-title="Themis Agent Menu" data-theme="c">
    <div data-role="header" data-position="default" data-theme="f">
        <h1>Agent List</h1>
    </div>
    <div data-role="content" data-theme="d" style="min-height: 640px">
        <div data-role="content-primary">
            <ul data-role="listview" data-nodeset="instance('agents')/rdf:Description" data-inset="true"
                data-filter="true">
                <li>
                    <a id="agentItem" href="#agentPage" data-transition="slide" data-ref="lsc:nkey">
                        <h3>
                            <output data-ref="foaf:name"/>
                        </h3>
                        <p><strong>Case Association</strong></p>

                        <p>This is text to be displayed for each agent.</p>

                        <p class="ui-li-aside">
                            <output data-ref="lsc:nkey"/>
                        </p>
                    </a>
                </li>
            </ul>
        </div>
    </div>
    <!-- /content -->

    <div data-role="footer" data-position="fixed">
        <a href="#agentsPage" data-icon="back">Return to Inbox</a>
        <a href="#agentsPage" data-icon="forward" class="ui-btn-right">Continue</a>
    </div>
    <!-- /footer -->
</div>
<div id="agentPage" data-role="page" data-title="Agent">
    <div data-role="header" data-theme="f" data-position="default">
        <a href="#agentsPage" data-icon="back" data-direction="reverse">Back</a>

        <h1>Agent</h1>
        <a href="#agentsPage" data-icon="save" data-direction="reverse">Save</a>
    </div>
    <div data-role="content" data-theme="f" style="min-height: 640px">
        <div data-role="content-primary">
            <form id="testForm2" action="#">
                <div id="group2" data-ref="instance('agent-out')/rdf:Description" data-role="group">
                    <fieldset>
                        <div data-role="fieldcontain">
                            <label for="nkey1">Id: </label>
                            <input id="nkey1" type="text" data-ref="lsc:nkey"/>
                        </div>
                        <div data-role="fieldcontain">
                            <label for="name1">Name: </label>
                            <input id="name1" type="text" data-ref="foaf:name"/>
                        </div>
                    </fieldset>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
</html>